<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!--<script src="test.js"></script>-->
<body>
    <div id="app">
        <p>{{message}}</p>
        <input type="text" v-model="message">
        <p></p>
        <button v-on:click="func01">dianji</button>
        <p>price: {{total}}</p>
        <p>one: {{price}}, num: {{num}}</p>
        <label>num: </label><input type="text" v-model="num">
        <p>{{msg}}</p>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                message: 'hello Vul!!',
                msg: 'hahaah',
                price: 20,
                num: 1
            },
            watch: {
                message(newmsg, oldmsg) {
                    console.log(newmsg,oldmsg)
                }
            },

            methods: {
                func01() {
                    this.message= "dianjishijian"
                }
            },

            computed :{
                total() {
                    return this.price * this.num
                }
            },

            filters: {
                func1(msg) {
                    return msg ? msg.toUpperCase() : ''
                }
            }
        })
        console.log(vm.$data.message);
        console.log(vm.message);
    </script>
</body>
</html>